<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
    <style>
        /*v-ebter 是进入元素起始状态
        v-leave-to  这是一个时间点是离开的终止状态*/
        .v-enter,
        .v-leave-to {
            opacity: 0;
            transform: translateX(150px);
        }

        .v-enter-active,
        .v-leave-active {
            transition: all 0.8s ease;
        }

        /*自定义动画标签*/
        .my-enter,
        .my-leave-to {
            opacity: 0;
            transform: translateY(150px);
        }

        .my-enter-active,
        .my-leave-active {
            transition: all 0.8s ease;
        }
    </style>
</head>
<body>
<div id="app">
    <input type="button" value="togglr" @click="flag=!flag">
    <!--    transition vue 动画使用的准用标签-->
    <transition>
        <h3 v-if="flag"> 是否隐藏
        </h3>
    </transition>
    <hr>
    <input type="button" value="togglr2" @click="flag2=!flag2">
    <!--    transition vue 动画使用的准用标签-->
    <transition name="my">

        <h3 v-if="flag2"> 是否隐藏

        </h3>
    </transition>
</div>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            flag: false,
            flag2: false
        },
        methods: {}
    })
</script>
</body>
</html>